 import axios from "axios"//引入axios
 import ElementPlus from 'element-plus'//引入element-plus
 import 'element-plus/dist/index.css'//引入样式

const service = axios.create({//创建axios实例
  baseURL: "http://localhost:8888/",
  timeout: 3000,
});

//拦截器 添加token
service.interceptors.request.use((config) => {//请求拦截器
  //添加token
  const token = localStorage.getItem('token')  
  config.headers['token'] = token
  return config
});

export default service;